<h3 mat-dialog-title>
  上次交易（{{lastTrans && lastTrans.id ? '修改' : '新建'}}）
</h3>

<mat-dialog-content>
  <form [formGroup]="form" novalidate>

    <mat-form-field class="full-width">
      <input matInput [readonly]="lastTrans && !!lastTrans.id" placeholder="基础币种" formControlName="baseCcy">
    </mat-form-field>

    <mat-form-field class="full-width">
      <input matInput [readonly]="lastTrans && !!lastTrans.id" placeholder="报价币种" formControlName="quoteCcy">
    </mat-form-field>

    <mat-radio-group [disabled]="lastTrans && !!lastTrans.id" class="radio-group-side mat-form-field" formControlName="side">
      <mat-radio-button value="buy">买入</mat-radio-button>
      <mat-radio-button value="sell">卖出</mat-radio-button>
    </mat-radio-group>

    <mat-form-field class="full-width">
      <input matInput type="number" placeholder="执行均价" formControlName="avgPrice">
    </mat-form-field>

    <mat-form-field class="full-width">
      <input matInput type="number" placeholder="执行数量" formControlName="execQty">
    </mat-form-field>

    <mat-form-field class="full-width">
      <input matInput placeholder="交易所" formControlName="ex">
    </mat-form-field>

  </form>
</mat-dialog-content>

<div mat-dialog-actions align="end">
  <button mat-button mat-dialog-close>取消</button>
  <button mat-button color="primary" cdkFocusInitial (click)="save()">保存</button>
</div>
